package cm309.BookingSystem.vm;

import java.sql.Connection;
import java.sql.DriverManager;

public class VenueDao {
	static {
		try {
			Class.forName("org.h2.Driver");			
		} catch (ClassNotFoundException e){
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection() {
		try {
			Connection conn = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test", "sa", "");
			conn.setAutoCommit(false);
			conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
			return conn;

		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}   
	}
}
